<!-- 微信实名认证 -->
<template>
  <div class="warp">
    <div class="number">申请编号：{{ infoData.applicationNo }}</div>
    <div class="content">
      <img class="line1" src="@/assets/icons/finance/finish.png" alt="" />

      <!-- 已完成聚合支付开通 -->
      <div v-if="infoData.status === 2">
        <div class="line2">
          <a>恭喜您，已完成聚合支付的开通，聚合支付商户编码为：{{ infoData.merchantNo }}</a>
        </div>
        <div class="_pt-20" style="text-align: center">
          <a-button type="primary" ghost @click="handleSelect">查看入网资料</a-button>
          <a-button class="_ml-10" type="primary" @click="handleToPaySetting">配置收款方式</a-button>
        </div>
      </div>

      <div v-else class="disFlxCC">
        <div class="line2">
          <a>恭喜您，已完成入网业务开通，聚合支付商户编码为：{{ infoData.merchantNo }}</a>
          <a-button class="_ml-10" type="primary" ghost @click="handleSelect">查看入网资料</a-button>
        </div>
        <div class="line3">
          按微信官方要求，您开通小程序微信支付业务，还需进行实名认证，若该机构已开通微信支付，请微信支付商户管理员扫码完成实名认证；若未开通，请让联系人或法人扫码完成实名认证。
        </div>
        <img class="line4" :src="code" alt="" />
        <div class="line5">
          微信扫码完成实名认证

          <!-- <a class="_ml-20 fz-16">不会实名认证？查看实名认证指引</a> -->
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { SelectMerchantStatus, WechatAuthCode } from '@/api/finance/finance'
export default {
  components: {},
  data() {
    return {
      tenantId: undefined,
      infoData: {},
      code: undefined,
    }
  },
  computed: {},
  watch: {},
  methods: {
    async getSelectMerchantStatus() {
      let res = await SelectMerchantStatus({ tenantId: this.tenantId })
      this.infoData = res.data || {}
      // //审核已驳回
      // if (this.infoData.applicationStatus === 'REVIEW_BACK') {
      //   this.current = 1
      // }
    },
    async getWechatAuthCode() {
      let res = await WechatAuthCode()
      this.code = res.data
    },
    handleSelect() {
      this.$emit('setCurrent', 0, true)
    },
    handleToPaySetting() {
      this.$router.push({
        path: '/system/paySettings',
      })
    },
  },
  created() {
    this.tenantId = this.$route.query.tenantId
    this.getSelectMerchantStatus()
    this.getWechatAuthCode()
  },
  mounted() {},
}
</script>
<style lang="less" scoped>
.warp {
  .number {
    font-size: 16px;
    font-weight: bold;
  }
  .content {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 50px 0;
    box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    margin-top: 30px;
    .line1 {
      width: 50px;
      height: 50px;
    }
    .line2 {
      font-size: 16px;
      margin: 20px 0;
    }
    .line3 {
      width: 800px;
      font-size: 16px;
      text-indent: 2em;
    }
    .line4 {
      width: 200px;
      margin: 30px 0;
    }
  }
}
</style>
